from flask import session
from info import create_app, db, models

from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand

app = create_app("develop")
# 可以传参设置代码环境：develop:代表在开发环境下的类 DevelopmentConfig
#                       product:代表生产（上线）环境ProductionConfig


# 创建manager对象
manager = Manager(app)

# 创建migrate对象,添加命令
Migrate(app, db)
manager.add_command("db", MigrateCommand)


if __name__ == '__main__':
    app.run()
